home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / nrpas13.arc / FPOLY.DEM < prev    next >
Text File  |  1991-05-01  |  563b  |  29 lines

  1. PROGRAM d14r6(input,output);
  2. (* driver for routine FPOLY *)
  3. CONST
  4.    nval=15;
  5.    dx=0.1;
  6.    npoly=5;
  7. TYPE
  8.    glnparray = ARRAY [1..npoly] OF real;
  9. VAR
  10.    i,j : integer;
  11.    x : real;
  12.    afunc : glnparray;
  13.  
  14. (*$I MODFILE.PAS *)
  15. (*$I FPOLY.PAS *)
  16.  
  17. BEGIN
  18.    writeln;
  19.    writeln('powers of x':38);
  20.    writeln('x':8,'x**0':11,'x**1':10,'x**2':10,'x**3':10,'x**4':10);
  21.    FOR i := 1 to nval DO BEGIN
  22.       x := i*dx;
  23.       fpoly(x,afunc,npoly);
  24.       write(x:10:4);
  25.       FOR j := 1 to npoly DO write(afunc[j]:10:4);
  26.       writeln
  27.    END
  28. END.
  29.